View.vue
<template>
  <h1>日期事件选择器组件</h1>
  <el-date-picker
    type="date"
    format="YYYY年MM月DD日"
    value-format="YYYY年MM月DD日"
    v-model="date"
    @change="console.log(date)"
  ></el-date-picker>
  <hr>
  <el-date-picker
    v-model="times"
    type="datetimerange"
    start-placeholder="开始时间"
    end-placeholder="结束时间"
    range-separator="到"
  ></el-date-picker>
</template>

<script setup>
  import {ref} from "vue";

  const date = ref('');
  const times = ref([]);
</script>

<style scoped>

</style>